package com.campus.manage.service.impl;

import java.util.List;
import com.campus.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.campus.manage.mapper.ClubMapper;
import com.campus.manage.domain.Club;
import com.campus.manage.service.IClubService;

/**
 * 社团Service业务层处理
 * 
 * @author hehe
 * @date 2025-10-22
 */
@Service
public class ClubServiceImpl implements IClubService 
{
    @Autowired
    private ClubMapper clubMapper;

    /**
     * 查询社团
     * 
     * @param clubId 社团主键
     * @return 社团
     */
    @Override
    public Club selectClubByClubId(Long clubId)
    {
        return clubMapper.selectClubByClubId(clubId);
    }

    /**
     * 查询社团列表
     * 
     * @param club 社团
     * @return 社团
     */
    @Override
    public List<Club> selectClubList(Club club)
    {
        return clubMapper.selectClubList(club);
    }

    /**
     * 新增社团
     * 
     * @param club 社团
     * @return 结果
     */
    @Override
    public int insertClub(Club club)
    {
        club.setCreateTime(DateUtils.getNowDate());
        return clubMapper.insertClub(club);
    }

    /**
     * 修改社团
     * 
     * @param club 社团
     * @return 结果
     */
    @Override
    public int updateClub(Club club)
    {
        club.setUpdateTime(DateUtils.getNowDate());
        return clubMapper.updateClub(club);
    }

    /**
     * 批量删除社团
     * 
     * @param clubIds 需要删除的社团主键
     * @return 结果
     */
    @Override
    public int deleteClubByClubIds(Long[] clubIds)
    {
        return clubMapper.deleteClubByClubIds(clubIds);
    }

    /**
     * 删除社团信息
     * 
     * @param clubId 社团主键
     * @return 结果
     */
    @Override
    public int deleteClubByClubId(Long clubId)
    {
        return clubMapper.deleteClubByClubId(clubId);
    }
}
